package dk.dashboardFP.panels.displayPanel {
	import dk.dashboardFP.elements.button.DFPButtonSubView;
	import dk.dashboardFP.interactionElementFramwork.inputElementViews.CheckBoxView;

	/**
	 * @author josef
	 */
	public class DFPToggleButtonView extends CheckBoxView {
		private var _sLabelText : String;
		private var _nWidth : Number;
		private var _doSubView : DFPButtonSubView;

		public function DFPToggleButtonView(sLabelText:String, nWidth:Number=NaN) {
			
			_nWidth = nWidth;
			_sLabelText = sLabelText;
			super();
			
			setupElements();
		}
		
		private function setupElements() : void {
			
			//:::::::
			// subview 
			_doSubView=new DFPButtonSubView(_sLabelText);
			addChild(_doSubView);
		}

		override public function setCheked() : void {
			super.setCheked();
			
			_doSubView.setOn();
		}

		override public function setUnCheked() : void {
			super.setUnCheked();

			_doSubView.setOff();
		}
	}
}
